package org.sean.framework.alibaba.config;

//import com.alibaba.csp.sentinel.config.SentinelConfig;
//import com.alibaba.csp.sentinel.transport.config.TransportConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.commons.util.InetUtils;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 自动配置
 */
@Configuration
public class AlibabaApplicationConfiguration {

    @Configuration
    static class SentinelConfiguration {
        @Autowired
        private InetUtils inetUtils;

        @PostConstruct
        public void init() {
            // client Ip
//            SentinelConfig.setConfig(TransportConfig.HEARTBEAT_CLIENT_IP, inetUtils.findFirstNonLoopbackHostInfo().getIpAddress());
        }
    }
}
